import { request } from "../../utils/http"

Page({
  data: {
    results: [],
    achievement: {}
  },

  getRecords (id) {
    request(`/api/portal/exam/achievement/${id}|complete`).then(data => {
      this.setData({
        achievement: data.achievement,
        results: data.achievementQuestionList
      })
    })
  },

  onLoad: function (options) {
    this.getRecords(options.id)
  }
})
